Skip to content

Detect linked issues at the end of PR bodies in provider testing issue - #70396

Merged
shahar1 merged 2 commits into
apache:mainfrom
shahar1:worktree-fix-linked-issue-regex
Jul 27, 2026
Merged

Detect linked issues at the end of PR bodies in provider testing issue#70396
shahar1 merged 2 commits into
apache:mainfrom
shahar1:worktree-fix-linked-issue-regex

Conversation

@shahar1

@shahar1 shahar1 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The provider testing issue generator (breeze release-management generate-issue-content-providers) silently missed linked issues whose reference is the last thing in the PR body — a common shape, since Fixes #NNNNN often sits on the final line. ISSUE_MATCH_IN_BODY (r" #([0-9]+)[^0-9]") requires a non-digit character after the number, which doesn't exist at end of string after the body's lines are joined.

Concrete occurrence: in the google 22.3.0rc1 testing issue (#70355), PR #69161 (body ending with Fixes #53843) was rendered with no linked issues, and the release manager had to add #53843 by hand.

Replacing the trailing [^0-9] with a negative lookahead (?![0-9]) matches the same references without requiring a trailing character. Verified against the real #69161 body: the old pattern finds nothing, the new one finds 53843; mid-body references behave identically.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5)

Generated-by: Claude Code (Fable 5) following the guidelines

The provider testing issue generator missed linked issues when the
reference was the last thing in the PR body (a common shape: "Fixes
character after the number, which does not exist at end of string, so
the reference was silently dropped and the release manager had to add
the issue to the testing issue by hand (e.g. apache#53843 for the google
22.3.0rc1 issue). A negative lookahead matches the same references
without needing a trailing character.
@shahar1
shahar1 force-pushed the worktree-fix-linked-issue-regex branch from 0924b00 to f21538d Compare July 24, 2026 15:12

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — the old [^0-9] needed a trailing character to exist, so a reference as the last thing in the body was silently dropped. Lookahead is the right fix. I traced both call sites (release_management_commands.py:2925 and :4749), and the parametrized cases genuinely fail against the old pattern, so the test earns its place.

Worth noting the fix quietly cures a second bug the description doesn't mention: because [^0-9] consumed a character, adjacent references lost the separator the next match needed — on #111 #222 the old pattern matched #111, ate the space, and then missed #222 entirely.

Two nits inline, neither blocking; approving.


This review was drafted by an AI-assisted tool and
confirmed by an Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.

More on how Airflow handles maintainer review:
contributing-docs/05_pull_requests.rst.


Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting

Comment thread dev/breeze/tests/test_release_management_commands.py
The old pattern consumed the separator character, so back-to-back
references like "apache#111 apache#222" lost the second one — a test case now pins
the fixed behaviour. The byte-identical dead copy of ISSUE_MATCH_IN_BODY
in dev/assign_cherry_picked_prs_with_milestone.py is removed so grep
leads only to the live definition.

Generated-by: Claude Code (Fable 5)
@shahar1
shahar1 merged commit 9f8629c into apache:main Jul 27, 2026
303 of 304 checks passed
@shahar1
shahar1 deleted the worktree-fix-linked-issue-regex branch July 27, 2026 10:58
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 9f8629c v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants